Ext.Loader.setConfig({enabled: true});

Ext.require([
    'Ext.form.field.ComboBox',
    'Ext.form.FieldSet',
    'Ext.tip.QuickTipManager',
    'Ext.data.*'
]);

var menu;
var urlListMenu;

Ext.onReady(function() {
	// Define the model for a Menu
	Ext.regModel('menu', {
		fields: [
			{type: 'int', name: 'id'},
			{type: 'string', name: 'producto'},
			{type: 'string', name: 'sabor'},
			{type: 'string', name: 'tamano'},
			{type: 'string', name: 'full'},
			{type: 'int', name: 'precio'}
		],
        idProperty: 'id'
	});

	// The data store holding the states
	menu = Ext.create('Ext.data.Store', {
		model: 'menu',
        proxy: {
            // load using script tags for cross domain, if the data in on the same domain as
            // this page, an HttpProxy would be better
            type: 'ajax',            
            reader: {
                root: 'data',
                totalProperty: 'totalCount'
            }            
        }
	});

	/*
	// ComboBox with a custom item template
	var customTplCombo = Ext.create('Ext.form.field.ComboBox', {
		fieldLabel: 'Select a single state',
		renderTo: 'customTplCombo',
		displayField: 'name',
		width: 500,
		labelWidth: 130,
		store: store,
		queryMode: 'local',
		listConfig: {
			getInnerTpl: function() {
				return '<div data-qtip="{name}. {slogan}">{name} ({abbr})</div>';
			}
		}
	});	
	*/
});
